//
// Created by 123 on 2025/1/13.
//
#include "iostream"
#include "vector"
#include "algorithm"

void test1(){
    std::vector<int> v;
    v.push_back(1);
    v.push_back(2);
    v.push_back(4);
    v.push_back(5);
    v.push_back(3);
    v.push_back(4);
    v.push_back(4);
    int num = std::count(v.begin(),v.end(),4);
    std::cout << "4 count is=" << num << std::endl;
}

class Person{
public:
    std::string name;
    int age;

public:
    Person(std::string name,int age){
        this->name = name;
        this->age = age;
    }
    bool operator==(const Person& p){
        if(this->age == p.age){
            return true;
        }else{
            return false;
        }
    }

};

void test2(){
    std::vector<Person> v;
    v.push_back(Person("1",11));
    v.push_back(Person("2",11));
    v.push_back(Person("3",22));
    v.push_back(Person("4",33));
//    Person p("5",11);
    int num = std::count(v.begin(),v.end(), Person("6",11));
    std::cout << "5 same age count=" << num << std::endl;
}

int main156(){
//    test1();
    test2();
    return 0;
}